package com.zwk.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zwk.common.validator.annotation.ListValue;
import com.zwk.common.validator.group.AddGroup;
import com.zwk.common.validator.group.UpdateGroup;
import com.zwk.gulimall.product.annotation.Overall;
import com.zwk.gulimall.product.annotation.Relation;
import com.zwk.gulimall.product.service.CategoryBrandRelationService;
import com.zwk.gulimall.product.service.CategoryService;
import lombok.Data;
import org.hibernate.validator.constraints.CreditCardNumber;
import org.hibernate.validator.constraints.URL;
import org.junit.runners.Parameterized;


import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * 品牌
 * 
 * @author zhuwenkang
 * @email zhuwenkang@gmail.com
 * @date 2022-12-30 22:46:58
 */
@Data
@TableName("pms_brand")
//此表关联的表
@Relation({
		CategoryBrandRelationService.class
})
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@TableId
	@Null(message = "添加时不能存在ID",groups = AddGroup.class)
	@NotNull(message = "修改时必须存在ID",groups = UpdateGroup.class)
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名不能为空",groups = AddGroup.class)	//message:错误提示信息
	private String name;
	/**
	 * 品牌logo地址
	 */
	@URL
	@NotNull(groups = AddGroup.class)
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@NotNull(groups = AddGroup.class)
	@ListValue(value = {0,1},message = "只能输入{0,1}")	//自定义注解
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@Pattern(regexp = "^[a-zA-Z]$")
	@NotNull(groups = AddGroup.class)
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull
	@Min(value = 0,message = "sort只能是正整数")
	private Integer sort;

}
